package day4;

import java.util.Scanner;

public class HomeWork5 {
    public static void main(String[] args) {
        // fdhklkalfdskhafdklhfadkj12312321
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入原文：");
        String str = sc.next();
        System.out.print("请输入要查找的字符:");
        String input = sc.next();
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.substring(i, i + 1).equals(input)) {
                count ++;
            }
        }
        System.out.println(count);
    }
}
